package com.etongwl.socketlibrary.SocketManagerCore;

import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created by jason on 16/6/27.
 * 消息队列核心
 */
public class MessageQueueCore<T> {
    //消息队列
    private LinkedBlockingQueue<T> msgQueue;

    public MessageQueueCore(){
        msgQueue=new LinkedBlockingQueue<T>();
    }

    public T getMessage() throws InterruptedException {
        return msgQueue.take();
    }

    public void setMessage(T msg) throws InterruptedException {
        msgQueue.put(msg);
    }



}
